package com.leetcode.others;

/**
 * @author Dennis Li
 * @date 2020/7/19 21:53
 */
public class ProductExceptSelf_238 {

    public int[] productExceptSelf(int[] nums) {
        int[] output = new int[nums.length];
        for (int i = 0; i < nums.length; i++) {
            output[i] = 1;
            for (int j = 0; j < nums.length; j++) {
                if(j == i) continue;
                output[i] *= nums[j];
            }
        }
        return output;
    }

}
